#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int lengthOfLIS(vector<int>& nums) {
        int n = nums.size();
        vector<int>dp(n, 1);
        int ret = INT_MIN;
        for (int i = 1; i < n; i++)
        {
            for (int j = i - 1; j >= 0; j--)
            {
                if (nums[j] < nums[i])
                {
                    dp[i] = max(dp[j] + 1, dp[i]);

                    ret = max(ret, dp[i]);
                }
            }

            cout << dp[i] << ' ';
        }
        ret = max(ret, dp[0]);
        return ret;
    }
};